package www.dianbaozu.com.ui.my

import android.os.Bundle
import android.view.View
import www.dianbaozu.com.R
import www.dianbaozu.com.databinding.FragmentNewAboutUsBinding
import www.wen.com.common.lib.base.fragment.BaseVMFragment
import www.wen.com.common.lib.data.entities.ContractEntity
import www.wen.com.common.lib.extension.nav
import www.wen.com.common.lib.helper.loading.KeyHelper
import www.wen.com.common.lib.helper.loading.TitleBarUniversalAdapter

/**
 * @author WEN
 * @Description: 关于我们
 * @date 2020//25 17:48
 */
class AboutUsFragment : BaseVMFragment<FragmentNewAboutUsBinding>() {

    override fun isEnableLoadingHelper(): Boolean = true

    override fun getTitleBarUniversalAdapter(): TitleBarUniversalAdapter = TitleBarUniversalAdapter(requireActivity(), "关于我们", action = ::titleAction)

    override fun getLayoutId(): Int = R.layout.fragment_new_about_us

    override fun lazyInitView() {}

    override fun onClick(v: View) {
        when (v.id) {
            R.id.llChangePassword -> {
                nav(R.id.action_newAboutUsFragment_to_contractFragment, args = Bundle().apply {
                    putParcelable(KeyHelper.BUNDLE_DATA, ContractEntity("用户协议", "用户协议"))
                })

            }
            R.id.llAccountSecurity -> {
                nav(R.id.action_newAboutUsFragment_to_contractFragment, args = Bundle().apply {
                    putParcelable(KeyHelper.BUNDLE_DATA, ContractEntity("隐私政策", "隐私政策"))
                })
            }
            R.id.llAboutTelegramGroup -> {
                nav(R.id.action_aboutUsFragment_to_aboutTelegraphGroupFragment)
            }
        }
    }

}



